package com.wjw.spring5.service;

import com.wjw.spring5.entity.User;
import com.wjw.spring5.mapper.UserDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author wjw
 * @date 2021年11月05日 19:38
 */
@Service
public class UserService {

    @Autowired
    private UserDao userDao;

    public int addUser(User user) {
        return userDao.addUser(user);
    }
    public int updateUser(User user) {
        return userDao.updateUser(user);
    }
    public int deleteUser(Integer id) {
        return  userDao.deleteUser(id);
    }

    public int queryValue() {
        return userDao.queryValue();
    }
    public User queryUser(Integer id) {
        return userDao.queryUser(id);
    }
    public List<User> queryAllUser() {
        return userDao.queryAllUser();
    }

    // 批量添加
    public int[] batchAdd(List<Object[]> batchArgs) {
        return userDao.batchAdd(batchArgs);
    }
    // 批量修改
    public int[] batchUpdateUser(List<Object[]> batchArgs) {
        return userDao.batchUpdateUser(batchArgs);
    }
    // 批量删除
    public int[] batchDelete(List<Object[]> batchArgs) {
        return userDao.batchDelete(batchArgs);
    }
}
